﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Wise.Util;

namespace Wise.Entities
{
    public enum 数据库类型 : int
    {
        微软数据库 = 0
    }

    public class _MyMap : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChange(string propertyName)
        {
            BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
            PropertyInfo prop = this.GetType().GetProperty(propertyName, flags);
            object value = prop.GetValue(this);
            if (_History.ContainsKey(propertyName))
            {
                object expiredValue = _History[propertyName];
                if(ObjectHelper.Equals(expiredValue, value))
                {
                    return;
                }
                else
                {
                    _History[propertyName] = value;
                }
            }
            else
            {
                _History.Add(propertyName, value);
            }
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        Dictionary<string,object> _History = new Dictionary<string, object>();
    }





   


}
